/**
 * Created by TianJing on 2017/3/22.
 */
var LabelController=function () {
    var self=this;
    this.labelList=$("#label-list");
    this.addBtn=$("#add-label");
    this.companyContent='<div class="form-group" style="margin-top: 40px;">' +
                            '<label class="col-sm-4">请输入中介公司标签: </label><input class="col-sm-6" type="text" name="companyLabelName">' +
                        '</div>';
    this.storeContent='<div class="form-group" style="margin-top: 40px;">' +
                            '<label class="col-sm-4">请输入门店标签: </label><input class="col-sm-6" type="text" name="storeLabelName">' +
                        '</div>';
};
LabelController.prototype={
    addLabel:function (fn) {
        var self=this;
        self.addBtn.off("click").on("click",function (e) {
            !!fn && $.isFunction(fn) && fn();
            e.stopPropagation();
        });
    },
    removeLabel:function (fn) {
        var self=this;
        self.labelList.off("click").on("click","i",function (e) {
            var $this=$(this);
            $this.parent().remove();
        });
    }
};
window.myLabel=new LabelController();